<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<title>视频下载</title>
<script type="text/javascript" src="${ctx}/js/ftp/progressBar.js"></script>
<link rel="stylesheet" type="text/css"
	href="${ctx}/css/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="${ctx}/css/easyui/demo.css">
<link rel="stylesheet" type="text/css"
	href="${ctx}/css/easyui/default.css">
<link rel="stylesheet" type="text/css"
	href="${ctx}/css/easyui/themes/icon.css">
<link rel="stylesheet" type="text/css"
	href="${ctx}/js/scripts/uploadify.css">
<script type="text/javascript"
	src="${ctx}/js/scripts/jquery-1.4.4.min.js"></script>
<script type="text/javascript"
	src="${ctx}/js/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript"
	src="${ctx}/js/easyui/src/jquery.parser.js"></script>
<script type="text/javascript" src="${ctx}/js/scripts/JSONUtil.js"></script>
<script type="text/javascript"
	src="${ctx}/js/easyui/local/easyui-lang-zh_CN.js"></script>

<script type="text/javascript" src="${ctx}/js/scripts/swfobject.js"></script>
<script type="text/javascript"
	src="${ctx}/js/scripts/jquery.uploadify.v2.1.4.min.js"></script>
<script type="text/javascript"
	src="${ctx}/js/scripts/jquery.edatagrid.js"></script>
<script type="text/javascript" src="${ctx}/js/scripts/util.js"></script>
<link type="text/css" rel="stylesheet"
	href="${ctx}/css/ftp/progressBar.css">
<script type="text/javascript">
var filePath="";
	function page_onload(){
		document.getElementById("status").value="1"; 
	}
	
	function save(){
		  //验证非空
	    var retVal = $("#addFTPContent").form("validate");
	    if(!retVal) {
	      return false;
	    } 
	      var formValues=$("#addFTPContent").serializeArray();
	        //附件路径
	        formValues.push({name:"filePath",value:filePath});
	      $.post("${ctx}/ftpUpload/add",formValues,function(data){
	        if(data.info=="success"){
	      	  $.messager.alert('系统提示', '保存成功', 'info', function(){
	      		  //opener.location.href=opener.location.href;
	                //opener=null;
	      		document.location.href="${ctx}/ftpUpload/getFtpList";
	      	  });
	            
	        }else{
	            //保存失败
	            $.messager.alert("保存失败","系统提示", "info",function(){
	          	  $('#save').attr("disabled",true);
	          	  });/* 保存失败 */
	          
	           
	        }
	    });
	}
	
	</script>
</head>

<body onload="page_onload()">

	<table align="center" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td height="8px" colspan="2">
				<form id="addFTPContent" name="addFTPContent" method="post">
					<table>
						<tr>
							<td>
								<input type="hidden" id="status" name="status"	value="${ftpAttachment.status}" />
								<input type="hidden" id="attaPath" name="attaPath"	value="${ftpAttachment.attaPath}" />
							</td>
						</tr>

						<tr style="min-height: 25">
							<td>标题:</td>
							<td><input type="text" class="easyui-validatebox w12"
								required="true" id="attaName" name="attaName"
								value="${ftpAttachment.attaName}" /></td>
						</tr>
						

						<tr>


							<td>分类:</td>
							<td><input type="text" class="easyui-validatebox w12"
								required="true" id="attaGroupId" name="attaGroupId"
								value="${ftpAttachment.attaGroupId}" maxlength="21" /></td>

						</tr>
						
						<tr style="min-height: 25">


							<td>简介:</td>
							<td><textarea  class="easyui-validatebox w12"
								required="true" id="content" name="content"
								>${ftpAttachment.content}</textarea></td>

						</tr>
						
						<tr>
							<td>关键字:</td>
							<td><textarea id="keywords" name="keywords"
									class="easyui-validatebox w10" validType="length[0,500]"
									rows="2" cols="90">${ftpAttachment.keywords}</textarea></td>
						</tr>
					</table>
				</form>
			</td>
		</tr>

		<tr>
			<td align="center" valign="bottom"><a href="#" id="save"
				class="easyui-linkbutton" iconCls="icon-save" plain="false"
				onclick="save()">保存</a>
			<!-- 保存 --></td>
		</tr>
	</table>
</body>
</html>
